1. Field of the Invention
Apparatuses and method consistent with the present invention relate to a nonvolatile memory, and more particularly, safely determining whether data stored in a nonvolatile memory is valid.
2. Description of the Related Art
Generally, embedded systems such as electric home appliances, communication appliances, and set-top boxes widely employ a nonvolatile memory as a storage medium that processes and stores data.
Flash memory is a commonly used nonvolatile memory device that can electrically write or erase data. Flash memory is suitable for portable devices because of its advantages of lower power consumption than that of a magnetic disc memory, fast access time like a hard disc, and small size.
A basic mechanism for storing data bits in the nonvolatile memory is the memory cell. A memory cell includes a single transistor provided with a control gate, floating gate, source, and drain. Here, data bits are stored by manipulating the charge in the floating gate in order to change a threshold voltage of the memory cell. Also, the memory cell is read by applying the selected voltage via a word line of the control gate.
A general memory cell provides a function for storing two states via 1 bit. That is, the memory cell stores a “1” bit for a state where data does not exist, or a “0” bit referring to a state where data is stored.
Technology for storing a plurality of bits in one memory cell has been researched in order to produce a high-capacity storage device having a low cost per bit.
The technology for reducing the cost per bit in a nonvolatile memory was introduced to the IEEE as “A Multilevel-Cell 32 Mb Flash Memory” by M. Bauer, (ISSCC Digest of Technical Papers, pp. 132 and 133 on February, 1995), which includes a technology for providing a function of storing four states via two bits per memory cell.
The nonvolatile memory that stores four states via two bits per memory cell is called as a multilevel cell (hereinafter, referred to as MLC), which stores data bits corresponding to two pages via one memory cell. Two pages corresponding to one memory cell are respectively called an. Least Significant Bit (LSB) page and an Most Significant Bit (MSB) page. The data bit is stored in the LSB page first.
In detail, the MLC nonvolatile memory has four states: S1, S2, S3, and S4, which are embodied as two bits as in FIG. 1. And each state includes a pair of data bits of the LSB page and the MSB page. When a block of the nonvolatile memory is erased, all memory cells in the block are in state S1. Here, if data bit is recorded in the LSB page, S1 is changed to S2, and, if data bit is recorded in the MSB page, S2 is changed to S3. The above steps are required in order so that S1 is changed to S4.
A nonvolatile-memory-based system may unexpectedly suffer from frequent power interruptions due to its characteristics. Therefore, the nonvolatile memory-based system needs a function for recovering data damaged or lost due to a power interruption.
FIG. 2 depicts a structure of a general nonvolatile memory.
The general nonvolatile memory 100 includes a plurality of blocks 110 including a plurality of pages 111. Each block size may be 16 KB, 64 KB, 128 KB, or 256 KB, which is decided by the number of pages included in the block and the page size. Here, the block is an erase unit of the nonvolatile memory, and the page is a write unit.
If power is cut off during the process of recording data in the nonvolatile memory 100, data may be incompletely recorded (incomplete program state). If power is cut off during the process of erasing data recorded in nonvolatile memory 100, data to be recorded may be incompletely recorded (incomplete program state). Thus, when referring to the data recorded in the nonvolatile memory 100, the validity of the data has to be determined first.
According to related art, to determine whether data is valid if power is cut off in the process of recording data, a field where a value showing that the writing operation is complete is recorded is located in a spare area. When the data is successfully recorded in the data area, “writing complete” is indicated in the field. The validity of data is determined according to the value recorded in the field.
Also, to determine whether data is valid if power is cut off in the process of erasing data, a field where a value showing that the erase operation is complete is recorded is located in each block. When data is all erased in the data area, “erase complete” is indicated in the field. The validity of the data is determined according to the value recorded in the field.
Although a value corresponding to “erase complete” is recorded in each field according to the above-described method, it is impossible to completely detect invalid data. If values of each field still remain because data is erased from only the data area, invalid data can be detected. Since the above method has to perform a write operation twice (data-write operation and “write complete” recording) for one page, it is not suitable for a nonvolatile memory whose number of partial programs (NOP) is once.
Exempting the above method, validity of data can be determined using an inverse checksum. The lower the voltage of a cell included in the nonvolatile memory is, the higher the inverse checksum p.
The inverse checksum can be used to determine the validity of data. However, the inverse checksum method can be applied only when it is assumed that the lower the voltage of cell included in the nonvolatile memory is, the higher number is indicated. When the inverse checksum is used in MLC memory, where the above assumption is not applied, invalid data may be considered as valid data, which is a problem.
Several inventions, e.g., Korean Unexamined Patent No. 2005-070672: “Method for Address Mapping and Managing Mapping Information, and Flash Memory thereof”, have been suggested. However, the above problem still remains to be solved.